$OpenBSD: patch-libkmime_kmime_util_cpp,v 1.1 2013/01/11 15:07:18 zhuk Exp $
--- libkmime/kmime_util.cpp.orig	Tue Dec 14 19:15:26 2010
+++ libkmime/kmime_util.cpp	Wed Dec 15 01:19:55 2010
@@ -154,7 +154,8 @@ QString decodeRFC2047String(const QCString &src, const
         declaredCS+=(*pos);
         pos++;
       }
-      if (*pos!='?' || i<4 || i>=maxLen) valid = FALSE;
+      if (*pos!='?' || i<4 || i>=maxLen || pos[1]=='\0' || pos[2]=='\0')
+        valid = FALSE;
       else
       {
         // get encoding and check delimiting question marks
